package com.example.design.strategy.promotion;

/**
 * @Description 策略模式测试类
 * @ClassName StrategyTest
 * @Author Yumuhui
 * @Date 2020/5/15 0:43
 * @Version 1.0.0
 */
public class StrategyTest {

    public static void main(String[] args) {
        Shopping shopping1 = new Shopping("书籍-深入理解Java虚拟机", 54.00);
        shopping1.setDiscount(new Dis9Discount());
        shopping1.calculate();

        Shopping shopping2 = new Shopping("Apple 妙控鼠标", 588.00);
        shopping2.setDiscount(new Dis8Discount());
        shopping2.calculate();

        Shopping shopping3 = new Shopping("戴尔U2417H显示器", 1479.00);
        shopping3.setDiscount(new Cash10Discount());
        shopping3.calculate();

        Shopping shopping4 = new Shopping("索尼ILCE-6000L相机", 3599.00);
        shopping4.setDiscount(new NoneDiscount());
        shopping4.calculate();
    }
}
